<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>blank</title>

    <!-- Bootstrap core CSS -->
    <link href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
    
  </head>

  <body>

	<form id="uploadForm" enctype="multipart/form-data">
        <input name="path" value="hd/sbjdj/" type="hidden">
        							
		<input id="files" type="file" name="files" multiple/>
		<button id="uploadbtn" type="button">upload</button>
	</form>

	<!-- Core JavaScript ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
    <script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="http://v3.bootcss.com/assets/js/ie10-viewport-bug-workaround.js"></script>
    
    <script type="text/javascript">
	    $(function() {
	    	$("#uploadbtn").on("click", function(){
	    		upload();
	        });
	    });
	    function upload(){
		    $.ajax({
		    	url : '/api/oss/upload',
		    	type : 'POST',
		    	data : new FormData($('#uploadForm')[0]),
		    	dataType : 'json',
		    	cache : false,
		    	crossDomain : true,
		    	processData : false,
		    	contentType : false,
		    	success : function(data) {
		    		alert(JSON.stringify(data));
		    	},
		    	error : function(jqXHR, textStatus, errorThrown) {
		    		alert(jqXHR.responseText);
		    		alert(jqXHR.status);
		    		alert(jqXHR.readyState);
		    		alert(jqXHR.statusText);
		    		alert(textStatus);
		    		alert(errorThrown);
		    	}
		    });
	    }
    </script>
    
  </body>
</html>